CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(voiceIP)

INCLUDE_DIRECTORIES(src)

# Set CMAKE_C_FLAGS variable with info from pkg-util
execute_process(COMMAND pkg-config --cflags gstreamer-0.10
                OUTPUT_VARIABLE CMAKE_C_FLAGS)
string(REPLACE "\n" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
message("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")

# Set CMAKE_EXE_LINKER_FLAGS variable with info from pkg-util
execute_process(COMMAND pkg-config --libs gstreamer-0.10
                OUTPUT_VARIABLE CMAKE_LINKER_FLAGS)
string(REPLACE "  \n" "" CMAKE_LINKER_FLAGS ${CMAKE_LINKER_FLAGS})
message("CMAKE_LINKER_FLAGS: ${CMAKE_LINKER_FLAGS}")

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(examples)

FIND_PACKAGE(Doxygen)

IF (DOXYGEN_FOUND)

SET(DOXYGEN_INPUT ${PROJECT_SOURCE_DIR}/Doxyfile.in)
SET(DOXYGEN_OUTPUT ${PROJECT_SOURCE_DIR}/doc)

ADD_CUSTOM_TARGET(doc COMMAND ${CMAKE_COMMAND} 
-E echo_append "Building API Documentation..."
  COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT}
  COMMAND ${CMAKE_COMMAND} -E echo "Done."
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

ENDIF (DOXYGEN_FOUND)

